﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IDE_week2_Forms_project

{


    using System.Globalization;
    using System.Threading;

    public partial class Form1 : Form
        // for language changing
    {
        static bool MyLang = true;
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }


        Form1 f1;
        Form2 f2;
        public Form1()
        {
            InitializeComponent();
            f1 = this;
        }

        private void OpenNewFormBtn_Click(object sender, EventArgs e)
        {
            f2 = new Form2();
            f2.Show();
        }

        private void ChangeIconBnt_Click(object sender, EventArgs e)
        {
            try
            {
                f1.Icon = Properties.Resources.Icon1;
                f2.Icon = Properties.Resources.Icon1;
            }
            catch (NullReferenceException) { return; }
        }

        private void ResetIconBtn_Click(object sender, EventArgs e)
        {
            f1.Icon = null;
            f2.Icon = null;

        }

      

        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem.ToString() == "Dutch")
            {
                
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
             comboBox1.Items.Add("English");
            comboBox1.Items.Add("Dutch");
            comboBox1.SelectedIndex = 0;
        }

        private void manner_Click(object sender, EventArgs e)
        {
            if (MyLang)
            {
                ChangeLanguage("nl");

            }
            else
            {
                ChangeLanguage("en");
            }
            MyLang = !MyLang;
        }

        private void CallClass1Btn_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            textBox1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("thanks for clicking me");
        }
        
        }
}
